package com.wzk.travelspringboot.dto;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;

/**
 * @Author: WangZiKang
 * @Date: 2025/1/5 14:00
 */
@Data
public class RegisterDTO {

    //昵称
    @NotBlank(message = "用户昵称不能为空")
    private String nikeName;

    //用户密码
    @NotBlank(message = "密码不能为空")
    @Length(min = 8,message = "密码长度不能少于8位！")
    private String password;

    @NotBlank(message = "确认密码不能为空")
    @Length(min = 8,message = "确认密码长度不能少于8位！")
    //确认密码
    private String rePassword;

    //用户手机
    @NotBlank(message = "手机号不能为空")
    @Length(min = 11, max = 11, message = "手机号只能为11位")
    @Pattern(regexp = "^1[3,5,7,8,9][0-9]{9}$", message = "手机号格式有误")
    private String phone;

    //用户邮箱
    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱不合法")
    private String email;

    //用户性别
    private Integer sex;

    //用户年龄
    @NotNull(message = "年龄不能为空")
    @Min(value = 0, message = "年龄不能小于 0")
    @Max(value = 120, message = "年龄不能大于 120")
    private Integer age;

    @NotBlank(message = "邮箱验证码不能为空")
    @Length(min = 6,max = 6,message = "邮箱验证码不合法")
    private String emailCode;

}
